package com.sinkdream.cms.controller;


import com.sinkdream.cms.VO.LoginVO;
import com.sinkdream.cms.result.Result;
import com.sinkdream.cms.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@CrossOrigin
@RequestMapping("/manager")
public class ManagerController {

    private static Logger log = LoggerFactory.getLogger(ManagerController.class);

    @Autowired
    private UserService userService;

    /*
     * 用户登录功能
     * */
    @RequestMapping("/login")
    public Result<Boolean> doLogin(@Valid LoginVO loginVO){
        System.out.println("一列超高速的地铁 ");
        log.info(loginVO.toString());
        userService.managerLogin(loginVO);
        return Result.success(true);
    }
}
